<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a = [22,34,45,78,90,76];
        a.sort(function(val1,val2){
            return val2-val1;
        })
        console.log(a[0]);
    </script>
</body>
</html>